package zzz.Text.text5;

import java.util.Scanner;

public class StringBuildertext {
    public static void main(String[] args) {
        //使用StringBuilder场景:
        //字符串的拼接
        //字符串的反转
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String str = sc.next();

        String result = new StringBuilder().append(str).reverse().toString();

        if(str.equals(result)){
            System.out.println("当前字符串是对称字符串");
        }else{
            System.out.println("当前字符串不是对称字符串");
        }

















        StringBuilder sb = new StringBuilder("三连");
        //添加元素
        sb.append(1).append(2.3).append(true);
        //反转
        sb.reverse();
        //获取长度
        int len = sb.length();
        System.out.println(len);
        //变回字符串
        sb.toString();
        System.out.println(sb);
    }
}
